import * as types from "../types/product" //相当于引进product所有内容并起了types 别名

// const createAction = (type, payload) => ({ type, payload })
/*
const createcAction = function (type){
    return function (payload){
        return{
            type,
            payload
        }
    }
}
可简写成如下形式:const createcAction = type => payload => ({ type, payload })
 */
const createcAction = type => payload => ({ type, payload })
// 关于product的actions

// 发起请求
const getProduct = createcAction(types.FETCH_PRODUCT)
// 正在获取商品
const getProductReq = createcAction(types.UPDATE_PRODUCT_REQ)
// 获取购物车商品成功
const getProductSuccess = createcAction(types.FETCH_PRODUCT_SUCCESS)
// 获取购物车商品失败
const getProductFail = createcAction(types.UPDATE_PRODUCT_FAIL)
// 添加购物车商品
const addToCart = createcAction(types.ADD_TO_CART)


